<template>
  <div class="dashboard-container">
    <div class="count">
      <el-row :gutter="20">
        <el-col :span="4"><div class="grid-content bg-purple">
          <img :src="img_url_1"/>
          <div class="right">
            <div class="money">{{ret.orderAmount}}</div>
            <div class="des">订单总金额</div>
          </div>
        </div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple">
          <img :src="img_url_1"/>
          <div class="right">
            <div class="money">{{ret.orderQuantity}}</div>
            <div class="des">订单总数</div>
          </div>
        </div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple">
          <img :src="img_url_1"/>
          <div class="right">
            <div class="money">{{ret.hospitalQuantity}}</div>
            <div class="des">医院数量</div>
          </div>
        </div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple">
          <img :src="img_url_1"/>
          <div class="right">
            <div class="money">{{ret.nurseQuantity}}</div>
            <div class="des">护士数量</div>
          </div>
        </div></el-col>
        <el-col :span="4"><div class="grid-content bg-purple">
          <img :src="img_url_1"/>
          <div class="right">
            <div class="money">{{ret.userQuantity}}</div>
            <div class="des">用户数量</div>
          </div>
        </div></el-col>
      </el-row>
    </div>

    <div class="user_order">
      <div class="one">
        <span class="font">订单统计</span>
        <div class="contentCount">
          <el-form label-width="100px" class="ms-content">
                <el-form-item label="今日订单总数">
                    <el-label>{{ret.todayOrderQuantity}}</el-label>
                </el-form-item>
                <el-form-item label="昨日订单总数">
                    <el-label>{{ret.yesterdayOrderQuantity}}</el-label>
                </el-form-item>
            </el-form>
        </div>
      </div>
      <div class="two">
        <span class="font">用户统计</span>
        <div class="contentCount">
          <el-form label-width="100px" class="ms-content">
                <el-form-item label="今日注册用户">
                    <el-label>{{ret.todayRegisterUserQuantity}}</el-label>
                </el-form-item>
                <el-form-item label="昨日注册用户">
                    <el-label>{{ret.yesterdayRegisterUserQuantity}}</el-label>
                </el-form-item>
            </el-form>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Dashboard',
  data() {
    return {
      img_url_1:require("../../assets/1.jpg"),
      ret: {},
    }
  },
  methods:{
    // 获取分页数据
		findPage: function () {

      this.$api.dashboard.findData(this.ret).then((res) => {
          debugger;
      if(res.code != 200) {
          this.$message({
          message: res.msg,
          type: 'error'
          })
      } else {
          this.ret = res.home;
      }
      }).catch((res) => {
          this.$message({
              message: res.message,
              type: 'error'
          })
      });



		},

    
  },
  mounted() {
    this.findPage()
  },
  created() {
  }
}
</script>

<style lang="scss" scoped>
  .dashboard-container {
    width: 1024px;
    max-width: 1024px;
    margin:20px auto;
    .count{
      width:100%;
      height:100px;
      padding:0 50px;
      .el-row {
        &:last-child {
          margin-bottom: 0;
        }
      }
      .grid-content {
        height:70px;
      }
      .right{
        width:50%;
        float:right;
        font-size:12px;
      }
      .money{
        height:50px;
        font-weight:bold;
      }
    }
    .user_order{
      width:60%;
      height:200px;
      padding:0 100px;
      margin-top:50px;
      .one{
        width:40%;
        height:100%;
        float:left;
      }
      .two{
        width:40%;
        height:100%;
        float:right;
      }
      .font{
        font-weight:bold;
      }
      .contentCount{
        width:60%;
        height:60%;
        border:1px solid black;
      }
    }
    
  }
  
  
</style>
